home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ File Icons 1.xpl < prev    next >
Text File  |  2001-08-04  |  4KB  |  122 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="9"
  3. "COUNT"="1"
  4. "UIPATH"="Appearance\Files&Folders\Files"
  5. "NAME"="Special File Icons"
  6. "VERSION"="2.12"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="TeXHeX rules!!!"
  9. "TEXT 1 COMMENT"="Neil T rules more!!!"
  10. "TEXT 1 COMMENT 2"="I don't believe this!!! TeX heX is so super cool it's his plug-ins are frozen!!!"
  11. "DESCRIPTION 1"="Enabling the items above will display the icons inside each file rather than using the generic icon that Windows uses by default. This may slow down your computer slightly, and not all files have icons in them, so these will be given the generic Windows 'Unknown File' icon."
  12. "DESCRIPTION 2"="'Display *.BMP files with a mini preview icon' will display a small preview of the bitmap instead of the icon. This might slow down your computer if you are viewing a folder with many images in it!"
  13. "DESCRIPTION 3"="Note: DO NOT activate 'Display BMP files with a mini preview icon' if you are using IE 5 with ActiveDesktop installed. This option *may* crash Windows Explorer in this case."
  14. "AUTHOR"="Xteq Systems"
  15. "CONTACTURL"="http://www.xteq.com"
  16. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  17. "COMMENT 1"="Thanks to Neil R. Turner [totalxs@hotmail.com] for adding support for the extra formats."
  18.  
  19. SUB Plugin_Initialize
  20. ' BMP files are a special case, so this has to run on its own.
  21.  Call SetUIElement(1,"Display *.BMP files with a mini preview icon")
  22.  s=RegReadValue("HKCR\Paint.Picture\DefaultIcon\@")
  23.  if s="%1" then SetUIElementEx 1,true
  24.  
  25. ' All other files run through a SUB to make this file smaller.
  26.   Call RunCheck("CPL",2)
  27.   Call RunCheck("DLL",3)
  28.   Call RunCheck("ICO",4)
  29.   Call RunCheck("ICL",5)
  30.   Call RunCheck("NIL",6)
  31.   Call RunCheck("IL",7)
  32.   Call RunCheck("OCX",8)
  33.   Call RunCheck("VBX",9)
  34.   Call RunCheck("DRV",10)
  35.   Call RunCheck("SCR",11)
  36.   Call RunCheck("ANI",12)
  37.   Call RunCheck("CUR",13)
  38. END SUB
  39.  
  40. SUB RunCheck(EXT,NUMB)
  41. ' "Why is this called RunCheck?" - Don't ask me....
  42.  Call SetUIElement(NUMB,"Display *." & EXT & " files as icons")
  43.  s=RegReadValue("HKCR\" & EXT & "file\DefaultIcon\@")
  44.  if s="%1" then
  45.   Call SetUIElementEx(NUMB,true)
  46.  end if
  47. END SUB
  48.  
  49. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  50.  b=GetUIElementEx(1)
  51.  Call DoChange(b,"HKCR\Paint.Picture\")
  52.  
  53.  b=GetUIElementEx(2)
  54.  Call DoChange(b,"HKCR\cplfile\")
  55.  
  56.  b=GetUIElementEx(3)
  57.  Call DoChange(b,"HKCR\dllfile\")
  58.  
  59.  b=GetUIElementEx(4)
  60.  Call DoChange(b,"HKCR\icofile\")
  61.  
  62.  b=GetUIElementEx(5)
  63.  Call DoChange(b,"HKCR\iclfile\")
  64.  
  65.  b=GetUIElementEx(6)
  66.  Call DoChange(b,"HKCR\nilfile\")
  67.  
  68.  b=GetUIElementEx(7)
  69.  Call DoChange(b,"HKCR\ilfile\")
  70.  
  71.  b=GetUIElementEx(8)
  72.  Call DoChange(b,"HKCR\ocxfile\")
  73.  
  74.  b=GetUIElementEx(9)
  75.  Call DoChange(b,"HKCR\vbxfile\")
  76.  
  77.  b=GetUIElementEx(10)
  78.  Call DoChange(b,"HKCR\drvfile\")
  79.  
  80.  b=GetUIElementEx(11)
  81.  Call DoChange(b,"HKCR\scrfile\")
  82.  
  83.  b=GetUIElementEx(12)
  84.  Call DoChange(b,"HKCR\anifile\")
  85.  
  86.  b=GetUIElementEx(13)
  87.  Call DoChange(b,"HKCR\curfile\")
  88. END SUB
  89.  
  90. SUB Plugin_Terminate
  91. END SUB
  92.  
  93. Sub DoChange(Activate, RegPath)
  94. ' I've left this as it is since TeXHeX is a much better programmer than me :)
  95.  if Activate=true then
  96.   'save backup
  97.   s=RegReadValue(RegPath & "DefaultIcon\@")
  98.  
  99.   if s<>"%1" then
  100.    Call RegWriteValue(RegPath & "DefaultIcon\K/oS X-Setup Backup",s,1) ' K/oS??? How old is this???
  101.                                                                        ' We have come a long way baby...
  102.  
  103.    'apply changes
  104.    Call RegWriteValue(RegPath & "DefaultIcon\@","%1",1)
  105.   end if
  106.  else
  107.   'restore backup
  108.   s=RegReadValue(RegPath & "DefaultIcon\K/oS X-Setup Backup")
  109.  
  110.   if IsEmpty(s)=false then
  111.    Call RegWriteValue(RegPath & "DefaultIcon\@",s,1)
  112.    'remove backup
  113.    Call RegDeleteValue(RegPath & "DefaultIcon\K/oS X-Setup Backup") 
  114.   else
  115.    'wooops! Something is wrong!
  116.    Call RegWriteValue(RegPath & "DefaultIcon\@","",1)
  117.    'Call MsgError("Error while trying to remove function for <" & RegPath & "> - no backup could be found!")
  118.   end if
  119.  end if
  120.  
  121. end Sub
  122.